package com.hcb.micro.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import com.hcb.micro.dto.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hcb.micro.controller.base.BaseControllers;
import com.hcb.micro.service.IAccountCityService;
import com.hcb.micro.service.IAccountDistrictService;
import com.hcb.micro.service.IAccountPlatformService;
import com.hcb.micro.service.IAccountProvinceService;
import com.hcb.micro.service.ICityService;
import com.hcb.micro.service.IDistrictService;
import com.hcb.micro.service.IProvinceService;
import com.hcb.micro.service.IQqbsAccountService;

import net.sf.json.JSONObject;

@Controller
@RequestMapping("partner")
public class PartnerController extends BaseControllers {

	@Autowired
	IQqbsAccountService qqbsAccountService;
	
	@Autowired
	IAccountProvinceService accountProvinceService;
	
	@Autowired
	IAccountCityService accountCityService;
	
	@Autowired
	IAccountDistrictService accountDistrictService;
	
	@Autowired
	IProvinceService provinceService;
	
	@Autowired
	ICityService cityService;
	
	@Autowired
	IDistrictService districtService;
	
	@Autowired
	IAccountPlatformService accountPlatformService;
	
	@RequestMapping(value = "list", method = RequestMethod.POST)
	@ResponseBody
	public String list() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		
		Map<String,Object> para = new HashMap<>();
		if (bodyInfo.get("accountId") != null && !"".equals(bodyInfo.get("accountId"))) {
			para.put("accountId", bodyInfo.getString("accountId"));
		}
		para.put("isPartner", (byte)1);
		
		List<AccountPlatform> apAllList = accountPlatformService.selectByPara(para);
		
		if(bodyInfo.get("page") != null && !"".equals(bodyInfo.get("page"))) {
			para.put("start", (Integer.valueOf(bodyInfo.getString("page"))-1)*Integer.valueOf(bodyInfo.getString("pageSize")));
		}
		if(bodyInfo.get("pageSize") != null && !"".equals(bodyInfo.get("pageSize"))) {
			para.put("size", Integer.valueOf(bodyInfo.getString("pageSize")));
		}
		List<AccountPlatform> apList = accountPlatformService.selectByPara(para);
		
		if(apList.size() <= 0){
			json.put("result", "1");
			json.put("description", "总代理列表不存在");
			return buildReqJsonObject(json);
		}
		
		List<Map<String,Object>> list = new ArrayList<>();
		for(AccountPlatform ap:apList){
			Map<String,Object> map = new HashMap<>();

			QqbsAccount qae = qqbsAccountService.selectByAccountId(ap.getAccountId());
			
			map.put("id", ap.getId()+"");
			map.put("accountId", ap.getAccountId()+"");
			map.put("nickname", qae.getNickname()+"");
			map.put("image", qae.getImage()+"");

			list.add(map);
		}
		
    	json.put("result", "0");
		json.put("description", "获取总代理列表成功");
		json.put("list", list);
		json.put("count", apAllList.size());
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "accountProvinceList", method = RequestMethod.POST)
	@ResponseBody
	public String accountProvinceList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
		if(manager == null){
			json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
		}
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		
		Map<String,Object> para = new HashMap<>();
		if (bodyInfo.get("accountId") != null && !"".equals(bodyInfo.get("accountId"))) {
			para.put("accountId", bodyInfo.getString("accountId"));
		}
			
		Map<String,Object> accountProvincePara = new HashMap<>();
		accountProvincePara.put("accountId", bodyInfo.getString("accountId"));
		List<AccountProvince> accountProvinceList = accountProvinceService.selectByPara(accountProvincePara);
		List<Map<String,Object>> accountProvinceListView = new ArrayList<>();
		if(accountProvinceList.size()>0){
			for(AccountProvince accountProvince:accountProvinceList){
				Map<String,Object> accountProvinceMap = new HashMap<>();
				
				Province province  = provinceService.selectByProvinceId(accountProvince.getProvinceId());
				
				accountProvinceMap.put("id", accountProvince.getId());
				accountProvinceMap.put("provinceId", accountProvince.getProvinceId());
				accountProvinceMap.put("name", province==null?"":province.getName());
				accountProvinceMap.put("isAll", accountProvince.getIsAll());
				
				accountProvinceListView.add(accountProvinceMap);
			}
		}else{
			json.put("result", "1");
			json.put("description", "没有物流配送区域");
			return buildReqJsonObject(json);
		}
		
		json.put("result", "0");
		json.put("description", "获取总代理列表成功");
		json.put("list", accountProvinceListView);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "accountCityList", method = RequestMethod.POST)
	@ResponseBody
	public String accountCityList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
		if(manager == null){
			json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
		}
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		
		Map<String,Object> para = new HashMap<>();
		if (bodyInfo.get("accountId") != null && !"".equals(bodyInfo.get("accountId"))) {
			para.put("accountId", bodyInfo.getString("accountId"));
		}
		if (bodyInfo.get("provinceId") != null && !"".equals(bodyInfo.get("provinceId"))) {
			para.put("provinceId", bodyInfo.getString("provinceId"));
		}
		
		List<AccountProvince> accountProvinceList = accountProvinceService.selectByPara(para);
		
		List<Map<String,Object>> accountCityListView = new ArrayList<>();
		
		if(accountProvinceList.size()>0 && accountProvinceList.get(0).getIsAll() == 1){
			List<City> cList = cityService.selectByProvinceId(Integer.valueOf(bodyInfo.getString("provinceId")));
			if(cList.size()>0){
				for(City city:cList){
					Map<String,Object> accountCityMap = new HashMap<>();
					
					accountCityMap.put("id", city.getId());
					accountCityMap.put("provinceId", city.getProvinceId());
					accountCityMap.put("cityId", city.getCityId());
					accountCityMap.put("name", city==null?"":city.getName());
					accountCityMap.put("isAll", (byte)1);
					
					accountCityListView.add(accountCityMap);
				}
			}
		}else{
			List<AccountCity> accountCityList = accountCityService.selectByPara(para);
			if(accountCityList.size()>0){
				for(AccountCity accountCity:accountCityList){
					Map<String,Object> accountCityMap = new HashMap<>();
					
					City city = cityService.selectByCityId(accountCity.getCityId());
					
					accountCityMap.put("id", accountCity.getId());
					accountCityMap.put("provinceId", accountCity.getProvinceId());
					accountCityMap.put("cityId", accountCity.getCityId());
					accountCityMap.put("name", city==null?"":city.getName());
					accountCityMap.put("isAll", accountCity.getIsAll());
					
					accountCityListView.add(accountCityMap);
				}
			}
		}
		
		json.put("result", "0");
		json.put("description", "获取总代理列表成功");
		json.put("list", accountCityListView);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "accountDistrictList", method = RequestMethod.POST)
	@ResponseBody
	public String accountDistrictList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
		if(manager == null){
			json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
		}
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		
		Map<String,Object> para = new HashMap<>();
		if (bodyInfo.get("accountId") != null && !"".equals(bodyInfo.get("accountId"))) {
			para.put("accountId", bodyInfo.getString("accountId"));
		}
		if (bodyInfo.get("cityId") != null && !"".equals(bodyInfo.get("cityId"))) {
			para.put("cityId", bodyInfo.getString("cityId"));
		}
		
		List<Map<String,Object>> accountDistrictListView = new ArrayList<>();
		
		if("1".equals(bodyInfo.getString("isAll"))){
			List<District> dList = districtService.selectByCityId(Integer.valueOf(bodyInfo.getString("cityId")));
			if(dList.size()>0){
				for(District district:dList){
					Map<String,Object> accountDistrictMap = new HashMap<>();
					
					accountDistrictMap.put("id", district.getId());
					accountDistrictMap.put("cityId", district.getCityId());
					accountDistrictMap.put("districtId", district.getDistrictId());
					accountDistrictMap.put("name", district==null?"":district.getName());
					accountDistrictMap.put("isAll", (byte)1);
					
					accountDistrictListView.add(accountDistrictMap);
				}
			}
		}else{
			List<AccountDistrict> accountDistrictList = accountDistrictService.selectByPara(para);
			if(accountDistrictList.size()>0){
				for(AccountDistrict accountDistrict:accountDistrictList){
					Map<String,Object> accountDistrictMap = new HashMap<>();
					
					District district = districtService.selectByDistrictId(accountDistrict.getDistrictId());
					
					accountDistrictMap.put("id", accountDistrict.getId());
					accountDistrictMap.put("cityId", accountDistrict.getCityId());
					accountDistrictMap.put("districtId", accountDistrict.getDistrictId());
					accountDistrictMap.put("name", district==null?"":district.getName());
					accountDistrictMap.put("isAll", accountDistrict.getIsAll());
					
					accountDistrictListView.add(accountDistrictMap);
				}
			}
		}
		
		json.put("result", "0");
		json.put("description", "获取总代理列表成功");
		json.put("list", accountDistrictListView);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "provinceList", method = RequestMethod.POST)
	@ResponseBody
	public String provinceList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
		List<Province> pList = provinceService.selectAll();
		
		if(pList.size() <= 0){
			json.put("result", "1");
			json.put("description", "省份列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,String>> list = new ArrayList<>();
		for(Province province:pList){
			Map<String,String> map = new HashMap<>();
			map.put("id", province.getId()+"");
			map.put("provinceId", province.getProvinceId()+"");
			map.put("name", province.getName());
			list.add(map);
		}
		
    	json.put("result", "0");
		json.put("description", "获取省份列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "cityList", method = RequestMethod.POST)
	@ResponseBody
	public String cityList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
        JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		int right = 1;
		if(bodyInfo.get("provinceId") == null || "".equals(bodyInfo.get("provinceId"))) {
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
		
		List<City> cList = cityService.selectByProvinceId(Integer.valueOf(bodyInfo.getString("provinceId")));
		
		if(cList.size() <= 0){
			json.put("result", "1");
			json.put("description", "市列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,String>> list = new ArrayList<>();
		for(City city:cList){
			Map<String,String> map = new HashMap<>();
			map.put("id", city.getId()+"");
			map.put("cityId", city.getCityId()+"");
			map.put("name", city.getName());
			list.add(map);
		}
		
    	json.put("result", "0");
		json.put("description", "获取市列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "districtList", method = RequestMethod.POST)
	@ResponseBody
	public String districtList() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
		if(manager == null){
			json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
		}
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		int right = 1;
		if(bodyInfo.get("cityId") == null || "".equals(bodyInfo.get("cityId"))) {
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
		
		List<District> dList = districtService.selectByCityId(Integer.valueOf(bodyInfo.getString("cityId")));
		
		if(dList.size() <= 0){
			json.put("result", "1");
			json.put("description", "地区列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,String>> list = new ArrayList<>();
		for(District district:dList){
			Map<String,String> map = new HashMap<>();
			map.put("id", district.getId()+"");
			map.put("cityId", district.getDistrictId()+"");
			map.put("name", district.getName());
			list.add(map);
		}
		
		json.put("result", "0");
		json.put("description", "获取地区列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "listOfProvince", method = RequestMethod.POST)
	@ResponseBody
	public String listOfProvince() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
        JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		int right = 1;
		if(bodyInfo.get("accountId") == null || "".equals(bodyInfo.get("accountId"))) {
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
        
		List<Province> pList = provinceService.selectAll();
		
		if(pList.size() <= 0){
			json.put("result", "1");
			json.put("description", "省份列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,Object>> list = new ArrayList<>();
		for(Province province:pList){
			
			Map<String,Object> map = new HashMap<>();
			map.put("id", province.getId()+"");
			map.put("provinceId", province.getProvinceId()+"");
			map.put("name", province.getName());
			
			map.put("accountId", bodyInfo.getInt("accountId"));
			List<AccountProvince> apList = accountProvinceService.selectByPara(map);
			if(apList.size()>0){
				map.put("isHave", 1);
			}else{
				map.put("isHave", 0);
			}
			
			list.add(map);
		}
		
    	json.put("result", "0");
		json.put("description", "获取省份列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "listOfCity", method = RequestMethod.POST)
	@ResponseBody
	public String listOfCity() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
        JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		int right = 1;
		if(bodyInfo.get("provinceId") == null || "".equals(bodyInfo.get("provinceId"))) {
			right = 0;
		}else if(bodyInfo.get("accountId") == null || "".equals(bodyInfo.get("accountId"))) {
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
		
		List<City> cList = cityService.selectByProvinceId(Integer.valueOf(bodyInfo.getString("provinceId")));
		
		if(cList.size() <= 0){
			json.put("result", "1");
			json.put("description", "市列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,Object>> list = new ArrayList<>();
		for(City city:cList){
			Map<String,Object> map = new HashMap<>();
			map.put("id", city.getId()+"");
			map.put("cityId", city.getCityId()+"");
			map.put("name", city.getName());
			
			map.put("accountId", bodyInfo.getInt("accountId"));
			List<AccountCity> acList = accountCityService.selectByPara(map);
			if(acList.size()>0){
				map.put("isHave", 1);
			}else{
				map.put("isHave", 0);
			}
			
			list.add(map);
		}
		
    	json.put("result", "0");
		json.put("description", "获取市列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "listOfDistrict", method = RequestMethod.POST)
	@ResponseBody
	public String listOfDistrict() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
		if(manager == null){
			json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
		}
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		int right = 1;
		if(bodyInfo.get("cityId") == null || "".equals(bodyInfo.get("cityId"))) {
			right = 0;
		}else if(bodyInfo.get("accountId") == null || "".equals(bodyInfo.get("accountId"))) {
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
		
		List<District> dList = districtService.selectByCityId(Integer.valueOf(bodyInfo.getString("cityId")));
		
		if(dList.size() <= 0){
			json.put("result", "1");
			json.put("description", "地区列表不存在");
			return buildReqJsonObject(json);
		}
		List<Map<String,Object>> list = new ArrayList<>();
		for(District district:dList){
			Map<String,Object> map = new HashMap<>();
			map.put("id", district.getId()+"");
			map.put("cityId", district.getDistrictId()+"");
			map.put("name", district.getName());
			
			map.put("accountId", bodyInfo.getInt("accountId"));
			List<AccountDistrict> adList = accountDistrictService.selectByPara(map);
			if(adList.size()>0){
				map.put("isHave", 1);
			}else{
				map.put("isHave", 0);
			}
			
			list.add(map);
		}
		
		json.put("result", "0");
		json.put("description", "获取地区列表成功");
		json.put("list", list);
		return buildReqJsonObject(json);
	}
	
	@RequestMapping(value = "detail", method = RequestMethod.POST)
	@ResponseBody
	public String detail() {
		JSONObject json = new JSONObject();
		if (sign == 1) {
			json.put("result", "1");
			json.put("description", "请检查参数格式是否正确或者参数是否完整");
			return buildReqJsonInteger(1, json);
		}
		// 登录认证失败
		if (sign == 2) {
			json.put("result", "2");
			json.put("description", "账号未登录");
			return buildReqJsonInteger(2, json);
		}
		
		HttpSession session = request.getSession();
		Manager manager = (Manager) session.getAttribute("MANAGER");
        if(manager == null){
        	json.put("result", "1");
			json.put("description", "账号未登陆");
			return buildReqJsonObject(json);
        }
		
		JSONObject bodyInfo = JSONObject.fromObject(bodyString);
		
		int right = 1;
		if(bodyInfo.get("accountId") == null || "".equals(bodyInfo.get("accountId"))){
			right = 0;
		}
		if(right == 0){
			json.put("result", "1");
			json.put("description", "操作失败，请检查输入的参数是否完整");
			return buildReqJsonObject(json);
		}
		
		Map<String,Object> map = new HashMap<>();
		QqbsAccount qae = qqbsAccountService.selectByAccountId(bodyInfo.getInt("accountId"));
		
		if(qae == null){
			json.put("result", "1");
			json.put("description", "用户不存在");
			return buildReqJsonObject(json);
		}
		
		map.put("id", qae.getId()+"");
		map.put("accountId", qae.getAccountId()+"");
		map.put("nickname", qae.getNickname()+"");
		map.put("image", qae.getImage()+"");
		
    	json.put("result", "0");
		json.put("description", "获取红包信息成功");
		json.put("account", map);
		return buildReqJsonObject(json);
	}
}
